Skip to content

Fix documentation issues for 4.x#780

Merged
markstory merged 3 commits into4.xfrom
docs-fixes-4x
Apr 3, 2026
Merged

Fix documentation issues for 4.x#780
markstory merged 3 commits into4.xfrom
docs-fixes-4x

Conversation

@dereuromark
Copy link
Copy Markdown
Member

@dereuromark dereuromark commented Apr 2, 2026

Summary

First Pass

  • Update AbstractIdentifier::CREDENTIAL_* to PasswordIdentifier::CREDENTIAL_* (constants moved in 4.x)
  • Add missing return types to code examples (initialize(): void, _setPassword(): string)
  • Fix broken tutorial link to use absolute CakePHP Book URL
  • Replace deprecated strpos() with str_starts_with() (PHP 8+)
  • Update API link from CakePHP 4.0 to 5
  • Remove misleading identifier config from Session authenticator examples (Session doesn't use identifiers)
  • Remove outdated "Added in version 2.10.0" notes that are confusing in 4.x docs
  • Add missing use Firebase\JWT\JWT; statement in JwksController example
  • Use strict comparison (===) instead of loose (==)
  • Add missing MiddlewareQueue type hints in migration guide
  • Remove unused ResponseInterface import
  • Add missing documentation links in contents.md (redirect-validation, upgrade-3-to-4)

Second Pass

  • Remove CONFIG double slash (CONFIG . '/jwt.key' -> CONFIG . 'jwt.key')
  • Fix 'explicity' typo -> 'explicitly'
  • Remove trailing comma from nonce default value
  • Update route syntax to CakePHP 5 ({controller} instead of :controller)
  • Remove additional Session authenticator identifier config in middleware.md
  • Remove outdated loadIdentifier() references (method removed in 4.x)
  • Fix grammar: 'an user' -> 'a user'
  • Add return types to IdentityInterface method examples
  • Update IdentifierCollection reference to reflect 4.x architecture (now uses single identifier)
  • Remove outdated ResponseInterface from docblock parameter
  • Use named arguments for finder: find('byToken', token: $token)
  • Use string instead of array for request->is('post')

Third Pass

  • Add return types to all controller action examples (login(), logout(), beforeFilter(), etc.)
  • Fix "Let's" grammar (was "Lets")
  • Fix stopImpersonation() typo -> stopImpersonating()
  • Replace deprecated TableRegistry::getTableLocator()->get() with fetchTable()
  • Fix indentation inconsistency in testing examples
  • Add missing redirect return in revertIdentity() example
  • Use fetchTable() instead of $this->Users property access
  • Use saveOrFail() instead of save() for better error handling
  • Use 'plugin' => false instead of 'plugin' => null for consistency
  • Add trailing commas in arrays

- Update AbstractIdentifier::CREDENTIAL_* to PasswordIdentifier::CREDENTIAL_*
- Add missing return types to code examples (initialize(), _setPassword())
- Fix broken tutorial link to use absolute CakePHP Book URL
- Replace deprecated strpos() with str_starts_with()
- Update API link from CakePHP 4.0 to 5
- Remove misleading identifier config from Session authenticator examples
- Remove outdated "Added in version 2.10.0" notes
- Add missing use statement for JWT in JwksController example
- Fix typo in jwt.pem path (./jwt.pem -> /jwt.pem)
- Use strict comparison (===) instead of loose (==)
- Add missing MiddlewareQueue type hints in migration guide
- Remove unused ResponseInterface import
- Add missing documentation links in contents.md (redirect-validation, upgrade-3-to-4)
- Remove CONFIG double slash (CONFIG . '/jwt.key' -> CONFIG . 'jwt.key')
- Fix 'explicity' typo -> 'explicitly'
- Remove trailing comma from nonce default value
- Update route syntax to CakePHP 5 ({controller} instead of :controller)
- Remove Session authenticator identifier config (Session doesn't use identifiers)
- Remove outdated loadIdentifier() references (removed in 4.x)
- Fix grammar: 'an user' -> 'a user'
- Add return types to IdentityInterface method examples
- Update IdentifierCollection reference to reflect 4.x architecture
- Remove outdated ResponseInterface from docblock
- Use named arguments for finder: find('byToken', token: $token)
- Use string instead of array for request->is('post')
@josbeir
Copy link
Copy Markdown
Contributor

josbeir commented Apr 2, 2026

maybe wait with this merge after #779 is in because it fixed a bunch of linting errors

@dereuromark
Copy link
Copy Markdown
Member Author

I would do the other way around. More important to get the wrong Infos fixed i guess

- Add return types to all controller action examples (login, logout, etc.)
- Fix "Let's" grammar (was "Lets")
- Fix `stopImpersonation()` typo -> `stopImpersonating()`
- Replace deprecated `TableRegistry::getTableLocator()->get()` with `fetchTable()`
- Fix indentation inconsistency in testing examples
- Add missing redirect return in revertIdentity() example
- Use `fetchTable()` instead of `$this->Users` property access
- Use `saveOrFail()` instead of `save()` for better error handling
- Use `'plugin' => false` instead of `'plugin' => null` for consistency
- Add trailing commas in arrays
@markstory markstory merged commit aedb109 into 4.x Apr 3, 2026
8 checks passed
@markstory markstory deleted the docs-fixes-4x branch April 3, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants